Imports System.Text

Public Class FolderBrowser

  Private Sub TestDialogButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TestDialogButton.Click
    fbd.Description = DescriptionTextBox.Text
    fbd.RootFolder = _
     CType(StartLocationComboBox.SelectedValue, _
     Environment.SpecialFolder)
    fbd.ShowNewFolderButton = ShowNewFolderCheckBox.Checked
    fbd.SelectedPath = ResultsLabel.Text

    If fbd.ShowDialog() = Windows.Forms.DialogResult.OK Then
      If String.IsNullOrEmpty(fbd.SelectedPath) Then
        ResultsLabel.Text = "<<Non-file system selection>>"
      Else
        ResultsLabel.Text = fbd.SelectedPath
      End If
    End If
  End Sub

  Private Sub FolderBrowser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ' The combo box will convert the enumerated values
    ' into their string representations for display:
    StartLocationComboBox.DataSource = _
     System.Enum.GetValues(GetType(Environment.SpecialFolder))
  End Sub


End Class
